package assdraw.command;

import java.awt.Color;

import assdraw.model.Drawing;
import assdraw.model.Line;


public class LineCommand implements AddCommand{

	private int startX, startY;
	public static int FIRST_CLICK  = 0;
	public static int SECOND_CLICK = 1;
	private int kind = 0;

	@Override
	public void execute(int x, int y, Drawing myDrawing, Color c) {
		if (kind == 0) {
			this.startX = x;
			this.startY = y;
			this.kind = 1;
		}
		else{
			myDrawing.addShape(new Line(startX, startY, x, y, c));
			kind = 0;
		}
	}

}
